import React, {Component} from 'react';
import './index.less';
import {promptBox, base} from 'nc-lightapp-front';

const {NCModal, NCButton} = base;
const {Header: NCModalHeader, Body: NCModalBody, Footer: NCModalFooter} = NCModal;

class StopAgreeModal extends Component {
    constructor(props) {
        super(props);
        this.closeModal = this.closeModal.bind(this);
        this.beSure = this.beSure.bind(this);
    }

    beSure() {
        this.props.beSure();
    }

    closeModal() {
        this.props.onClose && this.props.onClose();
    }

    render() {
        const {editTable, visible, json} = this.props;
        return (
            <NCModal
                show={visible}
                size="lg"
                onHide={this.closeModal}
                backdrop={'static'}
            >
                <NCModalHeader closeButton={true}>
                    {json['cm6011-000104']}
                    {/* 国际化处理： 合同终止*/}
                </NCModalHeader>
                <NCModalBody>
                    {
                        editTable.createEditTable('agreementgrid', {
                            cancelCustomRightMenu: true,
                            showCheck: true,
                            showIndex: true
                        })
                    }
                </NCModalBody>
                <NCModalFooter>
                    <NCButton colors="primary" onClick={this.beSure}>
                        {json['cm6011-000028']}
                        {/* 国际化处理： 确认*/}
                    </NCButton>
                    <NCButton shape="border" onClick={this.closeModal}>
                        {json['cm6011-000054']}
                        {/* 国际化处理： 取消*/}
                    </NCButton>
                </NCModalFooter>
            </NCModal>
        );
    }
}

export default StopAgreeModal;